//
//  BodyHeadGV.swift
//  demo01
//
//  Created by babybus on 2025/7/7.
//

import Foundation
import UIKit
import SnapKit
import Alamofire

class BodyHeadGVView:UIView{
    //全局变量
    private var strategyButton:UIButton = UIButton()
    private var rightsAndInterests:UIButton = UIButton()
    private var promptLabel:UILabel = UILabel()
    
    //初始化方法
    override init(frame: CGRect) {
        super.init(frame: frame)
        setupUI()
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func attributeInit(){}
    func setupUI(){
        strategyButton.setImage(UIImage(named: "攻略"), for: .normal)
        rightsAndInterests.setImage(UIImage(named: "权益"), for: .normal)
        setPromptLabel()
        
        self.addSubview(strategyButton)
        self.addSubview(rightsAndInterests)
        self.addSubview(promptLabel)
        strategyButton.snp.makeConstraints { make in
            make.width.equalTo(48)
            make.height.equalTo(31)
            make.top.equalToSuperview()
            make.right.equalToSuperview()
        }
        rightsAndInterests.snp.makeConstraints { make in
            make.width.equalTo(48)
            make.height.equalTo(31)
            make.top.equalTo(strategyButton.snp.bottom).offset(6)
            make.right.equalToSuperview()
        }
        promptLabel.snp.makeConstraints { make in
            make.top.equalToSuperview().inset(22)
            make.centerX.equalToSuperview()
            make.width.equalTo(272)
            make.height.equalTo(36)
        }
    }
    func setPromptLabel(){
        promptLabel.text = "获取资源数即将+20，在做一个任务吧~"
        promptLabel.backgroundColor = UIColor(red: 211/255, green: 242/255, blue: 255/255, alpha: 1.0)
        promptLabel.layer.cornerRadius = 15
        promptLabel.layer.masksToBounds = true
        promptLabel.textAlignment = .center
        promptLabel.font = UIFont.systemFont(ofSize: 13)
        promptLabel.adjustsFontSizeToFitWidth = true
        promptLabel.textColor = UIColor(red: 18/255, green: 89/255, blue: 130/255, alpha: 1.0)
    }
}
